﻿using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CMCCMicroBlog
{
    public class ItemViewModel : INotifyPropertyChanged
    {
        private string _nickName;
        /// <summary>
        /// 示例 ViewModel 属性；此属性在视图中用于使用绑定显示它的值。
        /// </summary>
        /// <returns></returns>
        public string NickName
        {
            get
            {
                return _nickName;
            }
            set
            {
                if (value != _nickName)
                {
                    _nickName = value;
                    NotifyPropertyChanged("NickName");
                }
            }
        }

        private string _feedText;
        /// <summary>
        /// 示例 ViewModel 属性；此属性在视图中用于使用绑定显示它的值。
        /// </summary>
        /// <returns></returns>
        public string FeedText
        {
            get
            {
                return _feedText;
            }
            set
            {
                if (value != _feedText)
                {
                    _feedText = value;
                    NotifyPropertyChanged("FeedText");
                }
            }
        }

        private Uri _feedImageUri;

        public Uri FeedImageUri
        {
            get
            {
                return _feedImageUri;
            }
            set
            {
                _feedImageUri = value;
                NotifyPropertyChanged("FeedImageUri");
            }
        }

        private Uri _originalImageUri;

        public Uri OriginalImageUri
        {
            get
            {
                return _originalImageUri;
            }
            set
            {
                _originalImageUri = value;
                NotifyPropertyChanged("OriginalImageUri");
            }
        }

        private Uri _iconImageUri;

        public Uri IconImageUri
        {
            get
            {
                return _iconImageUri;
            }
            set
            {
                _iconImageUri = value;
                NotifyPropertyChanged("IconImageUri");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}